<?php

namespace teach\controllers;

use teach\util\helper\ResponseHelper;
use Yii;
use yii\filters\VerbFilter;
use yii\web\Controller;

class RuleController extends Controller
{
    public $enableCsrfValidation = false;

    public function behaviors()
    {
        return [
            'verbs' => [
                'class' => VerbFilter::class,
                'actions' => [
                    '*' => ['post'],
                ],
            ],
        ];
    }

    /**
     * 积分 支票 说明
     * @return \yii\web\Response
     */
    public function actionExplain()
    {
        $data = [
            "ruler" => [
                [
                    "t" => "如何获取支票？",
                    "rulers" => [
                        "邀请好友加入绣学问平台",
                        "在绣学问平台商城中购买商品",
                    ],
                ],
                [
                    "t" => "如何使用积分/支票？",
                    "rulers" => [
                        "支付给代理商的金额会对应成为平台中支票金额",
                    ],
                ],
                [
                    "t" => "如何获取积分？",
                    "rulers" => [
                        "在年末的时候平台会推出积分兑换礼品，神秘大奖等着你！",
                        "在绣学问平台商城中购买商品，可以直接使用支票 比例(1支票=1元)"
                    ],
                ],
            ],
        ];
        $jsonData = ResponseHelper::buildJsonData(200, '成功', $data);
        return $this->asJson($jsonData);
    }
}